package leetcode.网易笔试.d;

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int n = sc.nextInt();
            int[] nums = new int[n];
            for (int i = 0; i < n; i++) {
                nums[i] = sc.nextInt();
            }
            System.out.println(solution(nums));
        }

    }



    public static int solution(int[] nums){
        int n = nums.length;
        int[] left = new int[nums.length];
        int[] right = new int[nums.length];
        for (int i = 1; i < left.length; i++) {
            if(nums[i]>nums[i-1]){
                left[i] = left[i-1]+1;
            }else if(nums[i]<nums[i-1]){
                left[i] = 0;
            }else{
                return 0;
            }
        }
        for (int i = right.length-2; i >=0; i--) {
            if(nums[i]>nums[i+1]){
                right[i] = right[i+1]+1;
            }else if(nums[i]<nums[i+1]){
                right[i] = 0;
            }else{
                return 0;
            }
        }
        int max = 0;
        for (int i = 0; i < n; i++) {
            int leftNum = left[i];
            int rightNum = right[i];
            max = Math.max(max,leftNum+rightNum+1);
        }
        if(max<3){
            return 0;
        }
        return max;
    }
}
